/******/ (function(modules) { // webpackBootstrap
/******/ 	// The module cache
/******/ 	var installedModules = {};
/******/
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/
/******/ 		// Check if module is in cache
/******/ 		if(installedModules[moduleId]) {
/******/ 			return installedModules[moduleId].exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = installedModules[moduleId] = {
/******/ 			i: moduleId,
/******/ 			l: false,
/******/ 			exports: {}
/******/ 		};
/******/
/******/ 		// Execute the module function
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ 		// Flag the module as loaded
/******/ 		module.l = true;
/******/
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/
/******/
/******/ 	// expose the modules object (__webpack_modules__)
/******/ 	__webpack_require__.m = modules;
/******/
/******/ 	// expose the module cache
/******/ 	__webpack_require__.c = installedModules;
/******/
/******/ 	// define getter function for harmony exports
/******/ 	__webpack_require__.d = function(exports, name, getter) {
/******/ 		if(!__webpack_require__.o(exports, name)) {
/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ 		}
/******/ 	};
/******/
/******/ 	// define __esModule on exports
/******/ 	__webpack_require__.r = function(exports) {
/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ 		}
/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
/******/ 	};
/******/
/******/ 	// create a fake namespace object
/******/ 	// mode & 1: value is a module id, require it
/******/ 	// mode & 2: merge all properties of value into the ns
/******/ 	// mode & 4: return value when already ns object
/******/ 	// mode & 8|1: behave like require
/******/ 	__webpack_require__.t = function(value, mode) {
/******/ 		if(mode & 1) value = __webpack_require__(value);
/******/ 		if(mode & 8) return value;
/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ 		var ns = Object.create(null);
/******/ 		__webpack_require__.r(ns);
/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ 		return ns;
/******/ 	};
/******/
/******/ 	// getDefaultExport function for compatibility with non-harmony modules
/******/ 	__webpack_require__.n = function(module) {
/******/ 		var getter = module && module.__esModule ?
/******/ 			function getDefault() { return module['default']; } :
/******/ 			function getModuleExports() { return module; };
/******/ 		__webpack_require__.d(getter, 'a', getter);
/******/ 		return getter;
/******/ 	};
/******/
/******/ 	// Object.prototype.hasOwnProperty.call
/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ 	// __webpack_public_path__
/******/ 	__webpack_require__.p = "";
/******/
/******/
/******/ 	// Load entry module and return exports
/******/ 	return __webpack_require__(__webpack_require__.s = 1);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});
/**
 * Created by George on 2018/2/10.
 */

function getNowFormatDate() {
    var date = new Date();
    var seperator1 = "-";
    var seperator2 = ":";
    var month = date.getMonth() + 1;
    var strDate = date.getDate();
    if (month >= 1 && month <= 9) {
        month = "0" + month;
    }
    if (strDate >= 0 && strDate <= 9) {
        strDate = "0" + strDate;
    }
    var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate;
    return currentdate;
}

function add(a, b) {
    var c, d, e;
    try {
        c = a.toString().split(".")[1].length;
    } catch (f) {
        c = 0;
    }
    try {
        d = b.toString().split(".")[1].length;
    } catch (f) {
        d = 0;
    }
    return e = Math.pow(10, Math.max(c, d)), (mul(a, e) + mul(b, e)) / e;
}

function mul(a, b) {
    var c = 0,
        d = a.toString(),
        e = b.toString();
    try {
        c += d.split(".")[1].length;
    } catch (f) {}
    try {
        c += e.split(".")[1].length;
    } catch (f) {}
    return Number(d.replace(".", "")) * Number(e.replace(".", "")) / Math.pow(10, c);
}

function getFormatDate(time) {
    return new Date(time).format("yyyy-MM-dd HH:mm:ss");
}

var util = {
    getNowFormatDate: getNowFormatDate,
    add: add,
    mul: mul,
    getFormatDate: getFormatDate
};

exports.default = util;

/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


var _frameRouter = __webpack_require__(2);

var _frameRouter2 = _interopRequireDefault(_frameRouter);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

(function () {
  // App入口
  (0, _frameRouter2.default)();
})(); /**
       * Created by George on 2019/4/26.
       */

/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _polyfill = __webpack_require__(3);

var _polyfill2 = _interopRequireDefault(_polyfill);

var _mainCtrl = __webpack_require__(4);

var _mainCtrl2 = _interopRequireDefault(_mainCtrl);

var _activityCtrl = __webpack_require__(5);

var _activityCtrl2 = _interopRequireDefault(_activityCtrl);

var _createActivityCtrl = __webpack_require__(6);

var _createActivityCtrl2 = _interopRequireDefault(_createActivityCtrl);

var _editActivityCtrl = __webpack_require__(7);

var _editActivityCtrl2 = _interopRequireDefault(_editActivityCtrl);

var _createDuesCtrl = __webpack_require__(8);

var _createDuesCtrl2 = _interopRequireDefault(_createDuesCtrl);

var _duesCtrl = __webpack_require__(9);

var _duesCtrl2 = _interopRequireDefault(_duesCtrl);

var _editDuesCtrl = __webpack_require__(10);

var _editDuesCtrl2 = _interopRequireDefault(_editDuesCtrl);

var _createNoteCtrl = __webpack_require__(11);

var _createNoteCtrl2 = _interopRequireDefault(_createNoteCtrl);

var _noteCtrl = __webpack_require__(12);

var _noteCtrl2 = _interopRequireDefault(_noteCtrl);

var _editNoteCtrl = __webpack_require__(13);

var _editNoteCtrl2 = _interopRequireDefault(_editNoteCtrl);

var _createUserCtrl = __webpack_require__(14);

var _createUserCtrl2 = _interopRequireDefault(_createUserCtrl);

var _userCtrl = __webpack_require__(15);

var _userCtrl2 = _interopRequireDefault(_userCtrl);

var _editUserCtrl = __webpack_require__(16);

var _editUserCtrl2 = _interopRequireDefault(_editUserCtrl);

var _paginationDirective = __webpack_require__(17);

var _paginationDirective2 = _interopRequireDefault(_paginationDirective);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// frameRouter.js

function frameRouter() {

    (0, _polyfill2.default)();

    var appNote = angular.module('appNote', ['ui.router']);

    appNote.controller("mainCtrl", _mainCtrl2.default);
    appNote.controller("activityCtrl", _activityCtrl2.default);
    appNote.controller("createActivityCtrl", _createActivityCtrl2.default);
    appNote.controller("editActivityCtrl", _editActivityCtrl2.default);
    appNote.controller("createDuesCtrl", _createDuesCtrl2.default);
    appNote.controller("duesCtrl", _duesCtrl2.default);
    appNote.controller("editDuesCtrl", _editDuesCtrl2.default);
    appNote.controller("createNoteCtrl", _createNoteCtrl2.default);
    appNote.controller("noteCtrl", _noteCtrl2.default);
    appNote.controller("editNoteCtrl", _editNoteCtrl2.default);
    appNote.controller("createUserCtrl", _createUserCtrl2.default);
    appNote.controller("userCtrl", _userCtrl2.default);
    appNote.controller("editUserCtrl", _editUserCtrl2.default);

    appNote.filter('trustHtml', function ($sce) {

        return function (input) {
            return $sce.trustAsHtml(input);
        };
    });

    appNote.directive('pageDirective', _paginationDirective2.default);

    appNote.run(['$rootScope', '$state', '$stateParams', function ($rootScope, $state, $stateParams) {
        $rootScope.$state = $state;
        $rootScope.$stateParams = $stateParams;
    }]).config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', function ($stateProvider, $urlRouterProvider, $controllerProvider) {
        $urlRouterProvider.when("", "/user");
        $urlRouterProvider.otherwise("/user");
        $stateProvider.state("activity", {
            url: '/activity',
            templateUrl: 'views/activity/activity.html',
            controller: 'activityCtrl'
        }).state("editActivity", {
            url: '/activity/edit/{activityId:.*}',
            templateUrl: 'views/activity/editActivity.html',
            controller: 'editActivityCtrl'
        }).state("createActivity", {
            url: '/activity/create',
            templateUrl: 'views/activity/createActivity.html',
            controller: 'createActivityCtrl'
        }).state("dues", {
            url: '/dues',
            templateUrl: 'views/dues/dues.html',
            controller: 'duesCtrl'
        }).state("editDues", {
            url: '/dues/edit/{duesId:.*}',
            templateUrl: 'views/dues/editDues.html',
            controller: 'editDuesCtrl'
        }).state("createDues", {
            url: '/dues/create',
            templateUrl: 'views/dues/createDues.html',
            controller: 'createDuesCtrl'
        }).state("user", {
            url: '/user',
            templateUrl: 'views/user/user.html',
            controller: 'userCtrl'
        }).state("editUser", {
            url: '/user/edit/{userId:.*}',
            templateUrl: 'views/user/editUser.html',
            controller: 'editUserCtrl'
        }).state("createUser", {
            url: '/user/create',
            templateUrl: 'views/user/createUser.html',
            controller: 'createUserCtrl'
        }).state("note", {
            url: '/note',
            templateUrl: 'views/note/note.html',
            controller: 'noteCtrl'
        }).state("createNote", {
            url: '/note/create',
            templateUrl: 'views/note/createNote.html',
            controller: 'createNoteCtrl'
        }).state("editNote", {
            url: '/note/edit/{noteId:.*}',
            templateUrl: 'views/note/editNote.html',
            controller: 'editNoteCtrl'
        });
    }]);

    angular.element(document).ready(function () {
        angular.bootstrap(document.body, ['appNote']);
    });
} /**
   * Created by George on 2018/1/28.
   * frame route
   */

exports.default = frameRouter;

/***/ }),
/* 3 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});
/**
 * Created by George on 2019/4/27.
 */

// 定义一些常用方法，支持浏览器兼容性问题
function polyfill() {
    Date.prototype.format = function (format) {
        var o = {
            "M+": this.getMonth() + 1, //month
            "d+": this.getDate(), //day
            "h+": this.getHours() % 12 == 0 ? 12 : this.getHours() % 12,
            "H+": this.getHours(), //hour
            "m+": this.getMinutes(), //minute
            "s+": this.getSeconds(), //second
            "q+": Math.floor((this.getMonth() + 3) / 3), //quarter
            "S": this.getMilliseconds() //millisecond
        };
        if (/(y+)/.test(format)) format = format.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o) {
            if (new RegExp("(" + k + ")").test(format)) format = format.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ("00" + o[k]).substr(("" + o[k]).length));
        }return format;
    };
}

exports.default = polyfill;

/***/ }),
/* 4 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});
/**
 * Created by George on 2018/1/28.
 * mainCtrl
 */
// 将本控制器函数作为结果返回给router.js
function mainCtrl($scope) {
    $scope.menuList = [{ name: "user", href: "#/user", class: "item-select" }, { name: "activity", href: "#/activity", class: "" }, { name: "dues", href: "#/dues", class: "" }, { name: "note", href: "#/note", class: "" }];
    $scope.value = "this is main ctrl.";
    $scope.welcome_info = "this is main ctrl.";

    function init() {
        var url = window.location.href;
        var routeValue = url.substr(url.indexOf('#'));
        initRoute(routeValue);
    }

    function initRoute(routeValue) {
        var itemSelect = false;
        for (var index = 0; index < $scope.menuList.length; index++) {
            if (routeValue.indexOf($scope.menuList[index].href) > -1 || routeValue === $scope.menuList[index].name) {
                itemSelect = true;
                $scope.menuList[index].class = 'item-select';
            } else {
                $scope.menuList[index].class = '';
            }
        }
        if (!itemSelect && $scope.menuList.length > 0) {
            $scope.menuList[0].class = 'item-select';
        }
    }

    $scope.itemClick = function (data) {
        initRoute(data.href);
    };

    $scope.$on('updateRoute', function (event, data) {
        initRoute(data);
    });

    //app start
    init();
}

exports.default = mainCtrl;

/***/ }),
/* 5 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function activityCtrl($scope, $http, $state) {
    $scope.welcome_info = "活动管理";
    $scope.activityRecordDatas = [];
    $scope.pageItems = [5, 10, 20, 100];
    $scope.pageInfo = {
        pageNo: 1,
        pageSize: 20,
        totalCnt: 0,
        pageNum: 1
    };
    $scope.$emit('updateRoute', 'activity');

    function init() {
        initOrUpdateData();
    }

    function initOrUpdateData() {
        $http.get("/basketballfire/rest/activity/list", { params: $scope.pageInfo }).then(function (data, status) {
            console.log(data);
            $scope.activityRecordDatas = data.data.data;
            $scope.pageInfo.totalCnt = data.data.totalCnt;
            $scope.pageList = [];
            var pageNum = Math.ceil($scope.pageInfo.totalCnt / $scope.pageInfo.pageSize); //分页数
            for (var index = 0; index < pageNum; index++) {
                $scope.pageList.push(index + 1);
            }
            $scope.pageInfo.pageNum = pageNum;
            for (var _index = 0; _index < $scope.activityRecordDatas.length; _index++) {
                var activityRecord = $scope.activityRecordDatas[_index];
                var usersDesc = "";
                for (var i = 0; i < activityRecord.records.length; i++) {
                    if (activityRecord.records[i].userNum > 1) {
                        usersDesc += " ;" + activityRecord.records[i].userName + " x " + activityRecord.records[i].userNum;
                    } else {
                        usersDesc += " ;" + activityRecord.records[i].userName;
                    }
                }
                usersDesc = usersDesc.substr(2);
                activityRecord.usersDesc = usersDesc;
                activityRecord.lastUpdateTimeDesc = _util2.default.getFormatDate(activityRecord.lastUpdateTime);
            }
        });
    }

    $scope.deleteActivity = function (activity) {
        var msg = "您真的确定要删除吗？";
        if (!confirm(msg)) {
            return;
        }
        $http.delete('/basketballfire/rest/activity?id=' + activity.id).then(function () {
            console.log("success!");
            alert("删除成功！");
            initOrUpdateData();
        }, function () {
            console.log("failed!");
            alert("删除失败！");
        });
    };

    $scope.selectPage = function (pageNo, pageSize) {
        $scope.pageInfo.pageNo = pageNo;
        $scope.pageInfo.pageSize = pageSize;
        initOrUpdateData();
    };

    //app start
    init();
} // 将本控制器函数作为结果返回给router.js

exports.default = activityCtrl;

/***/ }),
/* 6 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// 将本控制器函数作为结果返回给router.js
function createActivityCtrl($scope, $http, $state) {
    $scope.welcome_info = "活动管理";
    $scope.$emit('updateRoute', 'activity');

    function init() {
        initOrUpdateData();
    }

    function initOrUpdateData() {
        $scope.activity = {
            name: "篮球活动",
            date: _util2.default.getNowFormatDate(),
            dues: 0,
            userNum: 0,
            info: "租场费、水费",
            selectUsers: [],
            usersData: [],
            type: "0",
            typeData: [{ id: "0", name: "支出" }, { id: "1", name: "收入" }],
            number: 0
        };
        $scope.pageInfo = {
            pageNo: 1,
            pageSize: 100
        };

        $http.get("/basketballfire/rest/user/list", { params: $scope.pageInfo }).then(function (data, status) {
            console.log(data);
            var usersData = data.data.data;
            usersData.sort(function (a, b) {
                return a.name.localeCompare(b.name);
            });
            initUsersData(usersData);
        });
    }

    function initUsersData(usersData) {
        $scope.activity.usersData = [];
        for (var index = 0; index < usersData.length; index++) {
            var user1 = {
                "id": usersData[index].id,
                "name": usersData[index].name,
                "checked": false,
                "number": 1
            };
            $scope.activity.usersData.push(user1);
        }
    }

    $scope.selectUserChange = function () {
        var number = 0;
        $scope.activity.selectUsers = [];
        for (var index = 0; index < $scope.activity.usersData.length; index++) {
            if ($scope.activity.usersData[index].checked === true && $scope.activity.usersData[index].number > 0) {
                var user = {
                    userId: $scope.activity.usersData[index].id,
                    userNum: $scope.activity.usersData[index].number,
                    name: $scope.activity.usersData[index].name
                };
                number += $scope.activity.usersData[index].number;
                $scope.activity.selectUsers.push(user);
            }
        }
        $scope.activity.userNum = number;
    };

    $scope.addActivityClick = function () {
        $scope.activity.selectUsers = [];
        var number = 0;
        for (var index = 0; index < $scope.activity.usersData.length; index++) {
            if ($scope.activity.usersData[index].checked === true && $scope.activity.usersData[index].number > 0) {
                var user = {
                    userId: $scope.activity.usersData[index].id,
                    userNum: $scope.activity.usersData[index].number,
                    name: $scope.activity.usersData[index].name
                };
                number += $scope.activity.usersData[index].number;
                $scope.activity.selectUsers.push(user);
            }
        }

        $scope.activity.userNum = number;
        if ($scope.activity.selectUsers.length <= 0) {
            console.log("must select ");
            alert("必须选择人员");
            return;
        }

        if ($scope.activity.type === "1" && $scope.activity.dues < 0 || $scope.activity.type === "0" && $scope.activity.dues > 0) {
            $scope.activity.dues = -$scope.activity.dues;
        }

        var data = {
            "name": $scope.activity.name,
            "type": $scope.activity.type,
            "date": $scope.activity.date,
            "dues": $scope.activity.dues,
            "userNum": $scope.activity.userNum,
            "records": $scope.activity.selectUsers,
            "info": $scope.activity.info
        };
        $http.post('/basketballfire/rest/activity', data).then(function () {
            console.log("success!");
            alert("创建成功！");
            $state.go("activity");
        }, function () {
            alert("创建失败！");
            console.log("failed!");
        });
    };

    //app start
    init();
} /**
   * Created by George on 2018/2/25.
   */

exports.default = createActivityCtrl;

/***/ }),
/* 7 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// 将本控制器函数作为结果返回给router.js
function editActivityCtrl($scope, $http, $stateParams, $state) {
    $scope.welcome_info = "活动管理";
    $scope.$emit('updateRoute', 'activity');

    function init() {
        initOrUpdateData();
    }

    function initOrUpdateData() {
        $scope.activity = {
            id: "",
            name: "篮球活动",
            date: _util2.default.getNowFormatDate(),
            cost: 0,
            info: "租场费、水费",
            selectUsers: [],
            usersData: [],
            type: "0",
            typeData: [{ id: "0", name: "支出" }, { id: "1", name: "收入" }],
            number: 0
        };
        $scope.pageInfo = {
            pageNo: 1,
            pageSize: 100
        };
        $http.get("/basketballfire/rest/user/list", { params: $scope.pageInfo }).then(function (data, status) {
            console.log(data);
            var usersData = data.data.data;
            usersData.sort(function (a, b) {
                return a.name.localeCompare(b.name);
            });
            initUsersData(usersData);
            getActivityDetail();
        });
    }

    function getActivityDetail() {
        var activityId = $stateParams.activityId;
        $http.get("/basketballfire/rest/activity?id=" + activityId).then(function (data, status) {
            console.log(data);
            var activityData = data.data;
            $scope.activity.id = activityData.id;
            $scope.activity.name = activityData.name;
            $scope.activity.date = activityData.date;
            $scope.activity.dues = activityData.dues;
            $scope.activity.info = activityData.info;
            //转为为字符串，否则下拉框默认值无法选中
            $scope.activity.type = "" + activityData.type;
            for (var index = 0; index < activityData.records.length; index++) {
                for (var num = 0; num < $scope.activity.usersData.length; num++) {
                    if (activityData.records[index].userId == $scope.activity.usersData[num].id) {
                        $scope.activity.usersData[num].checked = true;
                        $scope.activity.usersData[num].number = activityData.records[index].userNum;
                        continue;
                    }
                }
            }
            $scope.selectUserChange();
        });
    }

    function initUsersData(usersData) {
        $scope.activity.usersData = [];
        for (var index = 0; index < usersData.length; index++) {
            var user1 = {
                "id": usersData[index].id,
                "name": usersData[index].name,
                "checked": false,
                "number": 1
            };
            $scope.activity.usersData.push(user1);
        }
    }

    $scope.editActivityClick = function () {
        $scope.activity.selectUsers = [];
        for (var index = 0; index < $scope.activity.usersData.length; index++) {
            if ($scope.activity.usersData[index].checked === true && $scope.activity.usersData[index].number > 0) {
                var user = {
                    userId: $scope.activity.usersData[index].id,
                    userNum: $scope.activity.usersData[index].number,
                    name: $scope.activity.usersData[index].name
                };
                $scope.activity.selectUsers.push(user);
            }
        }

        if ($scope.activity.selectUsers.length <= 0) {
            console.log("must select ");
            alert("必须选择人员");
            return;
        }

        if ($scope.activity.type === "1" && $scope.activity.dues < 0) {
            alert("收入金额必须大于零");
            return;
        }

        if ($scope.activity.type === "0" && $scope.activity.dues > 0) {
            alert("支出金额必须小于零");
            return;
        }

        var data = {
            "id": $scope.activity.id,
            "name": $scope.activity.name,
            "type": $scope.activity.type,
            "date": $scope.activity.date,
            "dues": $scope.activity.dues,
            "userNum": $scope.activity.number,
            "records": $scope.activity.selectUsers,
            "info": $scope.activity.info
        };
        $http.put('/basketballfire/rest/activity', data).then(function () {
            console.log("success!");
            alert("更新成功！");
            window.location.href = "/basketballfire/index.html#/activity";
            $state.go("activity");
        }, function () {
            alert("更新失败！");
            console.log("failed!");
        });
    };

    $scope.selectUserChange = function () {
        var number = 0;
        $scope.activity.selectUsers = [];
        for (var index = 0; index < $scope.activity.usersData.length; index++) {
            if ($scope.activity.usersData[index].checked === true && $scope.activity.usersData[index].number > 0) {
                var user = {
                    userId: $scope.activity.usersData[index].id,
                    userNum: $scope.activity.usersData[index].number,
                    name: $scope.activity.usersData[index].name
                };
                number += $scope.activity.usersData[index].number;
                $scope.activity.selectUsers.push(user);
            }
        }
        $scope.activity.number = number;
    };

    $scope.cancel = function () {
        window.location.href = "/basketballfire/index.html#/activity";
    };

    //app start
    init();
} /**
   * Created by George on 2018/2/24.
   */
;

exports.default = editActivityCtrl;

/***/ }),
/* 8 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// 将本控制器函数作为结果返回给router.js
var createDuesCtrl = function createDuesCtrl($scope, $http, $state) {
    $scope.welcome_info = "会费管理";
    $scope.recharge = {
        userId: "",
        dues: 100,
        date: _util2.default.getNowFormatDate(),
        info: "会费充值",
        usersData: [],
        type: "1",
        typeData: [{ id: "0", name: "支出" }, { id: "1", name: "收入" }]
    };
    $scope.pageInfo = {
        pageNo: 1,
        pageSize: 100
    };
    $scope.$emit('updateRoute', 'dues');

    function init() {
        initOrUpdateData();
    }

    function initOrUpdateData() {
        $scope.recharge = {
            userId: "",
            dues: 100,
            date: _util2.default.getNowFormatDate(),
            info: "会费充值",
            usersData: [],
            type: "1",
            typeData: [{ id: "0", name: "支出" }, { id: "1", name: "收入" }]
        };

        $http.get("/basketballfire/rest/user/list", { params: $scope.pageInfo }).then(function (data, status) {
            console.log(data);
            var usersData = data.data.data;
            usersData.sort(function (a, b) {
                return a.name.localeCompare(b.name);
            });
            initUsersData(usersData);
        });
    }

    function initUsersData(usersData) {
        $scope.recharge.usersData = [];
        for (var index = 0; index < usersData.length; index++) {
            var user0 = {
                "id": usersData[index].id,
                "name": usersData[index].name
            };
            $scope.recharge.usersData.push(user0);
        }
    }

    $scope.addRechargeClick = function () {
        // $scope.recharge.userId = $('#rechargeUsersSelect option:selected').val();
        if ($scope.recharge.type === "1" && $scope.recharge.dues < 0 || $scope.recharge.type === "0" && $scope.recharge.dues > 0) {
            $scope.recharge.dues = -$scope.recharge.dues;
        }
        var data = {
            "userId": $scope.recharge.userId,
            "dues": $scope.recharge.dues,
            "date": $scope.recharge.date,
            "info": $scope.recharge.info,
            "type": $scope.recharge.type
        };
        $http.post('/basketballfire/rest/dues', data).then(function () {
            console.log("success!");
            alert("创建成功！");
            $state.go("dues");
        }, function () {
            console.log("failed!");
            alert("创建失败！");
        });
    };

    init();
}; /**
    * Created by George on 2018/2/25.
    *
    */

exports.default = createDuesCtrl;

/***/ }),
/* 9 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

function duesCtrl($scope, $http, $state) {
    $scope.welcome_info = "会费管理";
    $scope.duesRecordDatas = [];
    $scope.pageItems = [5, 10, 20, 100];
    $scope.pageInfo = {
        pageNo: 1,
        pageSize: 20,
        totalCnt: 0,
        pageNum: 1
    };
    $scope.$emit('updateRoute', 'dues');

    function init() {
        initOrUpdateData();
    }

    function initOrUpdateData() {
        $http.get("/basketballfire/rest/dues/list", { params: $scope.pageInfo }).then(function (data) {
            console.log(data);
            $scope.duesRecordDatas = data.data.data;
            $scope.pageInfo.totalCnt = data.data.totalCnt;
            $scope.pageList = [];
            var pageNum = Math.ceil($scope.pageInfo.totalCnt / $scope.pageInfo.pageSize); //分页数
            for (var index = 0; index < pageNum; index++) {
                $scope.pageList.push(index + 1);
            }
            $scope.pageInfo.pageNum = pageNum;
            for (var i = 0; i < $scope.duesRecordDatas.length; i++) {
                var duesRecord = $scope.duesRecordDatas[i];
                duesRecord.lastUpdateTimeDesc = _util2.default.getFormatDate(duesRecord.lastUpdateTime);
            }
        });
    }

    $scope.deleteDues = function (dues) {
        var msg = "您真的确定要删除吗？";
        if (!confirm(msg)) {
            return;
        }
        if (dues.activityId !== "") {
            alert("活动消费不能直接删除！");
            return;
        }

        $http.delete('/basketballfire/rest/dues?id=' + dues.id).then(function () {
            console.log("success!");
            alert("删除成功！");
            initOrUpdateData();
        }, function () {
            console.log("failed!");
            alert("删除失败！");
        });
    };

    $scope.selectPage = function (pageNo, pageSize) {
        $scope.pageInfo.pageNo = pageNo;
        $scope.pageInfo.pageSize = pageSize;
        initOrUpdateData();
    };

    init();
} // 将本控制器函数作为结果返回给router.js

exports.default = duesCtrl;

/***/ }),
/* 10 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// 将本控制器函数作为结果返回给router.js
var editDuesCtrl = function editDuesCtrl($scope, $http, $stateParams, $state) {
    $scope.welcome_info = "会费管理";
    $scope.$emit('updateRoute', 'dues');

    function init() {
        initOrUpdateData();
    }

    function initOrUpdateData() {
        $scope.recharge = {
            id: "",
            userId: "",
            dues: 0,
            date: _util2.default.getNowFormatDate(),
            info: "会费充值",
            usersData: [],
            type: "1",
            typeData: [{ id: "0", name: "支出" }, { id: "1", name: "收入" }]
        };
        $scope.pageInfo = {
            pageNo: 1,
            pageSize: 100
        };
        $http.get("/basketballfire/rest/user/list", { params: $scope.pageInfo }).then(function (data, status) {
            console.log(data);
            var usersData = data.data.data;
            usersData.sort(function (a, b) {
                return a.name.localeCompare(b.name);
            });
            initUsersData(usersData);
            var duesId = $stateParams.duesId;
            $http.get("/basketballfire/rest/dues?id=" + duesId).then(function (data, status) {
                console.log(data);
                var duesRecord = data.data;
                if (duesRecord.activityId !== "") {
                    alert("活动消费不能直接编辑！");
                    window.location.href = "/basketballfire/index.html#/dues";
                    return;
                }
                $scope.recharge.id = duesRecord.id;
                $scope.recharge.userId = "" + duesRecord.userId;
                $scope.recharge.dues = duesRecord.dues;
                $scope.recharge.date = duesRecord.date;
                $scope.recharge.info = duesRecord.info;
                $scope.recharge.type = "" + duesRecord.type;
            });
        });
    }

    function initUsersData(usersData) {
        $scope.recharge.usersData = [];
        for (var index = 0; index < usersData.length; index++) {
            var user0 = {
                "id": usersData[index].id,
                "name": usersData[index].name
            };
            $scope.recharge.usersData.push(user0);
        }
    }

    $scope.editRechargeClick = function () {
        // $scope.recharge.userId = $('#rechargeUsersSelect option:selected').val();
        if ($scope.recharge.type === "1" && $scope.recharge.dues < 0 || $scope.recharge.type === "0" && $scope.recharge.dues > 0) {
            $scope.recharge.dues = -$scope.recharge.dues;
        }

        var data = {
            "id": $scope.recharge.id,
            "userId": $scope.recharge.userId,
            "dues": $scope.recharge.dues,
            "date": $scope.recharge.date,
            "info": $scope.recharge.info,
            "type": $scope.recharge.type
        };

        $http.put('/basketballfire/rest/dues', data).then(function () {
            console.log("success!");
            alert("更新成功！");
            $state.go('dues');
        }, function () {
            console.log("failed!");
            alert("更新失败！");
        });
    };

    $scope.cancel = function () {
        $state.go('dues');
    };

    init();
}; /**
    * Created by George on 2018/2/24.
    */

exports.default = editDuesCtrl;

/***/ }),
/* 11 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// 将本控制器函数作为结果返回给router.js
var createNoteCtrl = function createNoteCtrl($scope, $http, $state) {
    $scope.welcome_info = "笔记管理";
    $scope.note = {
        name: "",
        date: _util2.default.getNowFormatDate(),
        content: ""
    };
    $scope.$emit('updateRoute', 'note');

    ClassicEditor.create(document.querySelector('#editorContainer')).then(function (newEditor) {
        $scope.ckEditor = newEditor;
    }).catch(function (error) {
        console.error(error);
    });

    $scope.addNoteClick = function () {
        $scope.note.content = $scope.ckEditor.getData();
        console.log($scope.note);
        var data = {
            "name": $scope.note.name,
            "content": $scope.note.content,
            "date": $scope.note.date
        };
        $http.post('/basketballfire/rest/note', data).then(function (req) {
            console.log("success!");
            alert("创建成功！");
            $state.go('note', {});
        }, function (req) {
            console.log("failed!");
            alert("创建失败！");
        });
    };

    $scope.CancelClick = function () {
        console.log("click cancel");
        $state.go('note', {});
    };

    function init() {
        initOrUpdateData();
    }

    function initOrUpdateData() {}
    //TODO


    //app start
    init();
}; /**
    * Created by George on 2018/3/18.
    */

exports.default = createNoteCtrl;

/***/ }),
/* 12 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// 将本控制器函数作为结果返回给router.js
var noteCtrl = function noteCtrl($scope, $http) {
    $scope.welcome_info = "笔记管理";
    $scope.noteListDatas = [];
    $scope.emptyHtml = "<div>内容为空</div>";
    $scope.pageItems = [5, 10, 20, 100];
    $scope.pageInfo = {
        pageNo: 1,
        pageSize: 20,
        totalCnt: 0,
        pageNum: 1
    };
    $scope.$emit('updateRoute', 'note');

    $scope.deleteNote = function (data) {
        var msg = "您真的确定要删除吗？";
        if (!confirm(msg)) {
            return;
        }
        console.log(data);
        $http.delete('/basketballfire/rest/note?id=' + data.id, data).then(function () {
            console.log("success!");
            alert("删除成功！");
            initOrUpdateData();
        }, function () {
            console.log("failed!");
            alert("删除成功！");
        });
    };

    function init() {
        $scope.noteListDatas = [];
        initOrUpdateData();
    }

    function initOrUpdateData() {
        $http.get("/basketballfire/rest/note/list", { params: $scope.pageInfo }).then(function (data) {
            console.log(data);
            $scope.pageInfo.totalCnt = data.data.totalCnt;
            $scope.pageList = [];
            var pageNum = Math.ceil($scope.pageInfo.totalCnt / $scope.pageInfo.pageSize); //分页数
            for (var index = 0; index < pageNum; index++) {
                $scope.pageList.push(index + 1);
            }
            $scope.pageInfo.pageNum = pageNum;
            var notesData = data.data.data;
            $scope.noteListDatas = [];
            for (var i = 0; i < notesData.length; i++) {
                var tmpNote = notesData[i];
                var note = {
                    id: tmpNote.id,
                    name: tmpNote.name,
                    content: tmpNote.content || $scope.emptyHtml,
                    date: tmpNote.date,
                    createTime: _util2.default.getFormatDate(tmpNote.createTime),
                    lastUpdateTime: _util2.default.getFormatDate(tmpNote.lastUpdateTime)
                };
                $scope.noteListDatas.push(note);
            }
        });
    }

    $scope.isActivePage = function (page) {
        return page === $scope.pageInfo.pageNo;
    };

    $scope.selectPage = function (pageNo, pageSize) {
        $scope.pageInfo.pageNo = pageNo;
        $scope.pageInfo.pageSize = pageSize;
        initOrUpdateData();
    };

    //app start
    init();
}; /**
    * Created by George on 2018/3/18.
    */

exports.default = noteCtrl;

/***/ }),
/* 13 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// 将本控制器函数作为结果返回给router.js
var editNoteCtrl = function editNoteCtrl($scope, $http, $stateParams, $state) {
    $scope.welcome_info = "笔记管理";
    $scope.note = {
        id: "",
        name: "",
        date: _util2.default.getNowFormatDate(),
        content: ""
    };
    $scope.$emit('updateRoute', 'note');

    ClassicEditor.create(document.querySelector('#editorContainer')).then(function (newEditor) {
        $scope.ckEditor = newEditor;
    }).catch(function (error) {
        console.error(error);
    });

    $scope.editNoteClick = function () {
        $scope.note.content = $scope.ckEditor.getData();
        console.log($scope.note);
        var data = {
            "id": $scope.note.id,
            "name": $scope.note.name,
            "content": $scope.note.content,
            "date": $scope.note.date
        };
        $http.put('/basketballfire/rest/note', data).then(function (req) {
            console.log("success!");
            alert("修改成功！");
            $state.go('note', {});
        }, function (req) {
            console.log("failed!");
            alert("修改失败！");
        });
    };

    $scope.CancelClick = function () {
        console.log("click cancel");
        $state.go('note', {});
    };

    function init() {
        initOrUpdateData();
    }

    function initOrUpdateData() {
        $scope.note = {
            id: "",
            name: "",
            date: _util2.default.getNowFormatDate(),
            content: ""
        };

        var noteID = $stateParams.noteId;

        $http.get("/basketballfire/rest/note?id=" + noteID).then(function (data, status) {
            console.log(data);
            var noteData = data.data;
            $scope.note = {
                id: noteData.id,
                name: noteData.name,
                content: noteData.content,
                date: noteData.date
            };
            $scope.ckEditor.setData(noteData.content);
        }, function (req) {
            console.log("failed!");
            alert("note not exist！");
            $state.go('note', {});
        });
    }

    //app start
    init();
}; /**
    * Created by George on 2018/3/19.
    */
exports.default = editNoteCtrl;

/***/ }),
/* 14 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// 将本控制器函数作为结果返回给router.js
var createUserCtrl = function createUserCtrl($scope, $http, $state) {
    $scope.welcome_info = "会员管理";
    $scope.user = {
        name: "",
        dues: 0,
        info: "",
        joinDate: _util2.default.getNowFormatDate()
    };
    $scope.$emit('updateRoute', 'user');

    $scope.addMemberClick = function () {
        var data = {
            "name": $scope.user.name,
            "dues": $scope.user.dues,
            "info": $scope.user.info,
            "joinDate": $scope.user.joinDate
        };
        $http.post('/basketballfire/rest/user', data).then(function (req) {
            console.log("success!");
            alert("创建成功！");
            $state.go("user");
        }, function (req) {
            console.log("failed!");
            alert("创建失败！");
        });
    };

    function initOrUpdateData() {
        $scope.user = {
            name: "",
            dues: 0,
            info: "",
            joinDate: _util2.default.getNowFormatDate()
        };
    }

    function init() {
        initOrUpdateData();
    }

    //ctrl start
    init();
}; /**
    * Created by George on 2018/2/25.
    */

exports.default = createUserCtrl;

/***/ }),
/* 15 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// 将本控制器函数作为结果返回给router.js
var userCtrl = function userCtrl($scope, $http) {
    $scope.welcome_info = "会员管理";
    $scope.memberListDatas = [];
    $scope.dues = {
        consume: 0,
        realConsume: 0,
        leave: 0
    };
    $scope.pageItems = [5, 10, 20, 100];
    $scope.pageInfo = {
        pageNo: 1,
        pageSize: 100,
        totalCnt: 0,
        pageNum: 1
    };
    $scope.$emit('updateRoute', 'user');

    function initOrUpdateData() {
        $scope.dues = {
            consume: 0,
            realConsume: 0,
            leave: 0
        };

        $http.get("/basketballfire/rest/user/list", { params: $scope.pageInfo }).then(function (data) {
            console.log(data);
            $scope.pageInfo.totalCnt = data.data.totalCnt;
            $scope.pageList = [];
            var pageNum = Math.ceil($scope.pageInfo.totalCnt / $scope.pageInfo.pageSize); //分页数
            for (var index = 0; index < pageNum; index++) {
                $scope.pageList.push(index + 1);
            }
            $scope.pageInfo.pageNum = pageNum;
            var usersData = data.data.data;
            usersData.sort(function (a, b) {
                return a.name.localeCompare(b.name);
            });
            initUsersData(usersData);
        });
    }

    function init() {
        initOrUpdateData();
    }

    function initUsersData(usersData) {
        $scope.dues.leave = 0;
        var index;
        for (index = 0; index < usersData.length; index++) {
            $scope.dues.leave = _util2.default.add($scope.dues.leave, usersData[index].dues);
        }

        $scope.memberListDatas = [];
        for (index = 0; index < usersData.length;) {
            var data = {
                left: {},
                right: {}
            };
            data.left = usersData[index];
            if (index + 1 < usersData.length) {
                data.right = usersData[index + 1];
            }
            $scope.memberListDatas.push(data);
            index += 2;
        }
    }

    $scope.selectPage = function (pageNo, pageSize) {
        $scope.pageInfo.pageNo = pageNo;
        $scope.pageInfo.pageSize = pageSize;
        initOrUpdateData();
    };

    //ctrl start
    init();
}; /**
    * Created by George on 2018/1/27.
    * 用户列表
    */

exports.default = userCtrl;

/***/ }),
/* 16 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});

var _util = __webpack_require__(0);

var _util2 = _interopRequireDefault(_util);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// 将本控制器函数作为结果返回给router.js
var editUserCtrl = function editUserCtrl($scope, $http, $stateParams, $state) {
    $scope.welcome_info = "会员管理";
    $scope.user = {
        id: "",
        name: "",
        info: "",
        joinDate: _util2.default.getNowFormatDate()
    };
    $scope.$emit('updateRoute', 'user');

    $scope.editUser = function () {
        var data = {
            "id": $scope.user.id,
            "name": $scope.user.name,
            "info": $scope.user.info,
            "joinDate": $scope.user.joinDate
        };
        $http.put('/basketballfire/rest/user', data).then(function (req) {
            console.log("success!");
            alert("修改成功！");
            $state.go("user");
        }, function (req) {
            console.log("failed!");
            alert("修改失败！");
        });
    };

    $scope.cancel = function () {
        window.location.href = "/basketballfire/index.html#/user";
    };

    function initOrUpdateData() {
        $scope.user = {
            id: "",
            name: "",
            info: "",
            joinDate: _util2.default.getNowFormatDate()
        };

        var userID = $stateParams.userId;

        $http.get("/basketballfire/rest/user?id=" + userID).then(function (data, status) {
            console.log(data);
            var usersData = data.data;
            $scope.user = {
                id: usersData.id,
                name: usersData.name,
                info: usersData.info,
                joinDate: usersData.joinDate
            };
        });
    }

    function init() {
        initOrUpdateData();
    }

    //ctrl start
    init();
}; /**
    * Created by George on 2018/2/23.
    */

exports.default = editUserCtrl;

/***/ }),
/* 17 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";


Object.defineProperty(exports, "__esModule", {
    value: true
});
/**
 * Created by George on 2019/6/3.
 */

function paginationDirective() {
    return {
        restrict: 'E',
        scope: {
            totalCount: '=',
            pageSize: '=',
            currentPage: '=',
            pageItems: '=',
            goPage: '&'
        },
        controller: controller,
        templateUrl: "views/components/pagination.html"
    };

    function controller($scope) {
        $scope.totalPage = Math.ceil($scope.totalCount / $scope.pageSize);
        $scope.pageList = getPages($scope.totalPage, $scope.currentPage);
        //跳转到某一页
        function goPage() {
            var params = {
                pageSize: $scope.pageSize,
                pageNo: $scope.currentPage
            };
            $scope.goPage(params);
        }

        $scope.setCurrentPage = function (pageNo) {
            if (pageNo === '...' || pageNo === 0 || pageNo > $scope.totalPage || pageNo === '') {
                return;
            }
            $scope.currentPage = pageNo;
            $scope.pageList = getPages($scope.totalPage, $scope.currentPage);
            goPage();
        };

        //每页显示size改变
        $scope.changeSize = function () {
            initDefaultPages();
            goPage();
        };

        function initDefaultPages() {
            $scope.currentPage = 1;
            $scope.totalPage = Math.ceil($scope.totalCount / $scope.pageSize);
            $scope.pageList = getPages($scope.totalPage, $scope.currentPage);
        }

        $scope.$watch('currentPage', function () {
            $scope.pageList = getPages($scope.totalPage, $scope.currentPage);
        });

        $scope.$watch('totalCount', function () {
            initDefaultPages();
        });
        $scope.$watch('pageSize', function () {
            initDefaultPages();
        });

        function getPages(totalPage, currentPage) {
            currentPage = Math.min(totalPage, currentPage);
            var pages = [];
            if (totalPage <= 1) {
                pages.push(1);
            } else if (totalPage <= 4) {
                for (var index = 1; index <= totalPage; index++) {
                    pages.push(index);
                }
            } else {
                if (currentPage != 1) {
                    pages.push(1);
                }

                if (currentPage > 3) {
                    pages.push("...");
                }
                if (currentPage > 2) {
                    pages.push(currentPage - 1);
                }
                pages.push(currentPage);
                if (currentPage + 1 < totalPage) {
                    pages.push(currentPage + 1);
                }
                if (currentPage + 2 < totalPage) {
                    pages.push("...");
                }

                if (currentPage != totalPage) {
                    pages.push(totalPage);
                }
            }
            return pages;
        }
    }
}

exports.default = paginationDirective;

/***/ })
/******/ ]);